<?php

namespace App\Http\Resources\OpenShop\InvestmentPromotion;

use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\JsonResource;

class UserIdentityCardResource extends JsonResource
{
    /**
     * Transform the resource into an array.
     *
     * @param Request $request
     * @return array
     */
    public function toArray($request): array
    {
        return [
            'orderNo'            => $this->orderNo,
            'frontSideImg'       => privateFilePath($this->frontSideImg),
            'backSideImg'        => privateFilePath($this->backSideImg),
            'name'               => $this->name,
            'identityCardNumber' => $this->identityCardNumber,
            'gender'             => $this->gender,
            'effectiveStartTime' => formatDateYmd($this->effectiveStartTime),
            'effectiveEndTime'   => formatDateYmd($this->effectiveEndTime),
            'nativePlace'        => $this->nativePlace,
            'nation'             => $this->nation,
            'birthday'           => $this->birthday,
            'animalSign'         => $this->animalSign,
            'constellation'      => $this->constellation,
        ];
    }
}
